import request from '../utils/request';
/**
 * Tools 公共工具
 * 字典模块API资源文件
 * 
 * @author 小兔
 * @Date 20210905
 * @description
 */
 var base_url = "http://127.0.0.1:4890/portal";
 var baseRequest_url = base_url+'/admin/dic';
 // Dictionary 字典管理 --------------------------------------------------------------------Start
// 新增字典
export const saveDictionary = data => {
    return request({
        url: baseRequest_url+'/admin/dic/saveDictionary',
        method: 'post',
		data: data
    });
};

// 获取所有父级字典
export const findParentDictionaryList = query => {
    return request({
        url: baseRequest_url+'/admin/dic/findParentDictionaryList',
        method: 'get',
    });
};

// 通过父级id获取子级字典信息
export const findChildDictionaryListByParentId = query => {
    return request({
        url: baseRequest_url+'/admin/dic/findChildDictionaryListByParentId/'+query.parentId,
        method: 'get',
		params: query,
    });
};

// 通过父级编码获取字典信息
export const findDictionaryInfoByDicCode = query => {
    return request({
        url: baseRequest_url+'/admin/dic/findDictionaryInfoByDicCode',
        method: 'get',
		params: query,
    });
};
 // Dictionary 系统公共Code --------------------------------------------------------------------Start
// 新闻阅读权限字典
export const loadNewsReadPermissionsDict = query => {
    return request({
        url: baseRequest_url+'/admin/status/view/NewsReadPermissions',
        method: 'get',
		params: query,
    });
};

// 广告位展示方式字典
export const loadAdvertOpenWayDict = query => {
    return request({
        url: baseRequest_url+'/admin/status/view/AdvertOpenWayEnum',
        method: 'get',
		params: query,
    });
};

// 广告位展示位置字典
export const loadAdvertPositionDict = query => {
    return request({
        url: baseRequest_url+'/admin/status/view/AdvertPositionEnum',
        method: 'get',
		params: query,
    });
};

// 产品发布状态字典
export const loadProductPublishStatusDict = query => {
    return request({
        url: baseRequest_url+'/admin/status/view/productPublishStatus',
        method: 'get',
		params: query,
    });
};

// 会员等级晋升方式
export const loadMemberGradeUpWay = query => {
    return request({
        url: baseRequest_url+'/admin/status/view/MemberGradeUpWayEnum',
        method: 'get',
		params: query,
    });
};

// 产品发布状态字典
export const loadProvTrees = query => {
    return request({
        url: baseRequest_url+'/admin/childFetch',
        method: 'get',
		params: query,
    });
};

// 会员积分来源
export const loadIntegralWayEnum = query => {
    return request({
        url: baseRequest_url+'/admin/status/view/IntegralWayEnum',
        method: 'get',
		params: query,
    });
};

// 话题类型
export const loadSubjectCommonTypeEnum = query => {
    return request({
        url: baseRequest_url+'/admin/status/view/SubjectCommonTypeEnum',
        method: 'get',
		params: query,
    });
};

// 优惠券类型
export const loadCouponTypeEnum = query => {
    return request({
        url: baseRequest_url+'/admin/status/view/CouponTypeEnum',
        method: 'get',
		params: query,
    });
};

// 优惠券使用用途
export const loadCouponUseEnum = query => {
    return request({
        url: baseRequest_url+'/admin/status/view/CouponUseEnum',
        method: 'get',
		params: query,
    });
};